# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=2

inherit eselect-base

DESCRIPTION="Manages the AliEn symlink"
HOMEPAGE="http://www.gentoo.org/"
SRC_URI="$MY_SRC_PATH/eselect-alien-${PVR}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
IUSE=""

RDEPEND="sci-physics/eselect-alice"

src_install() {
  insinto /usr/share/eselect/modules
  newins "${WORKDIR}/${P}/alien.eselect" alien.eselect || die
  insinto /etc/profile.d
  newins "${WORKDIR}/${P}/profile.d/01alien.sh" 01alien.sh || die
  dodir /etc/alice-config/

#   dodir /opt/cern/alice/alien/
#   TESTLINK=`ls /opt/cern/alice/alien/`
#   if [ "$TESTLINK" == "" ]; then
#     dosym $ALIEN_DIR /opt/cern/alice/alien/
#   fi
}
